﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductEdit.ascx.cs"
    Inherits="HUGATE.Item.Controls.Product.ProductEdit" %>
<%@ Register Src="~/Controls/ERP/Item/Product_ProductAttribute/Product_ProductAttributeList.ascx"
    TagName="Product_ProductAttributeList" TagPrefix="uc2" %>
<%@ Register Src="~/Controls/ERP/Common/SearchObject.ascx" TagName="SearchObject"
    TagPrefix="uc1" %>
<%@ Register Src="../ProductAttribute/ProductAttributeInput.ascx" TagName="ProductAttributeInput"
    TagPrefix="uc3" %>
<script type="text/javascript">
    function CheckHTML(element) {
        var text = document.getElementById(element).value;
        if (text.indexOf('<') > -1 || text.indexOf('>') > -1) {
            alert("Chuỗi nhập có thẻ HTML");
            document.getElementById(element).value = "";
        }

    }
    function EnDisableIDText(ctl) {
        document.getElementById('<%=txtObjectID.ClientID %>').disabled = ctl.checked ? 'disabled' : '';
        document.getElementById('<%=txtObjectID.ClientID %>').value = '';
    }
</script>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
    <tr>
        <td class="Title_Left1">
            &nbsp;
        </td>
        <td class="Title_Title1">
            Thông tin sản phẩm
        </td>
        <td class="Title_Separator1">
            &nbsp;
        </td>
        <td class="Title_None1">
            &nbsp;
        </td>
        <td class="Title_Right1">
            &nbsp;
        </td>
        <td align="right" style="padding-right: 10px;">
        </td>
    </tr>
</table>
<table border="0" cellpadding="1" cellspacing="0" style="width: 100%" class="View_Table">
    <tr id="trID" runat="server">
        <td>
            Mã sản phẩm
        </td>
        <td>
            <asp:TextBox ID="txtObjectID" runat="server" ValidationGroup="checkDataInput" MaxLength="13"
                OnTextChanged="txtObjectID_TextChanged" Width="130px"></asp:TextBox>
            <asp:CheckBox ID="chkAutoGen" runat="server" Text="Tự động sinh" onclick="EnDisableIDText(this);" />
        </td>
        <td>
            Tên sản phẩm
        </td>
        <td>
            <asp:TextBox ID="txtObjectName" runat="server" MaxLength="200" ValidationGroup="checkDataInput"
                Width="280px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtObjectName"
                ErrorMessage="*" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td>
            Ngành sản phẩm
        </td>
        <td>
            <asp:UpdatePanel ID="udpCategory" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox ID="txtCategoryNameS" runat="server" ReadOnly="true" Width="230px"></asp:TextBox>
                    <asp:Button ID="btnChooseCategory" runat="server" CssClass="Control_ButtonBrowse"
                        Text="..." />
                    <asp:ImageButton ID="ibtClearCategory" runat="Server" ImageUrl="~/App_Themes/Default/Images/Buttons/btnDel.gif"
                        ToolTip="Clear" OnClick="ibtClearCategory_Click" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtCategoryNameS"
                        ErrorMessage="*" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
                    <asp:Panel ID="pnlInputCategory" runat="server" CssClass="Popup_Table" Style="display: none;
                        width: 300px">
                        <div class="Popup_Title">
                            <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                                <tr>
                                    <td>
                                        <strong>Chọn ngành sản phẩm</strong>
                                    </td>
                                    <td align="center" style="padding-right: 2px; width: 20px">
                                        <div class="Popup_BtClose" style="width: 16px; height: 17px; text-align: center">
                                            <asp:LinkButton ID="lbtCloseCategory" runat="server" CssClass="Popup_BtClose" Style="height: 17px">&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div style="overflow: scroll; height: 500px;">
                            <uc1:SearchObject ID="SOCategory" runat="server" Visible="false" />
                            <div class="Popup_Content">
                                <telerik:RadTreeView ID="rtvCategory" runat="server" OnNodeClick="rtvCategory_NodeClick">
                                </telerik:RadTreeView>
                            </div>
                        </div>
                    </asp:Panel>
                    <ajax:ModalPopupExtender ID="mpeCaragory" runat="server" BackgroundCssClass="ModalPopupBackground"
                        CancelControlID="lbtCloseCategory" PopupControlID="pnlInputCategory" TargetControlID="btnChooseCategory">
                    </ajax:ModalPopupExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td>
            Nhà sản xuất:
        </td>
        <td>
            <asp:UpdatePanel ID="udpManufacturer" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox ID="txtManufacturerNameS" runat="server" ReadOnly="true" Width="230px"></asp:TextBox>
                    <asp:Button ID="btnChooseManufacturer" runat="server" CssClass="Control_ButtonBrowse"
                        Text="..." />
                    <asp:ImageButton ID="ibtClearManufacturer" runat="Server" ImageUrl="~/App_Themes/Default/Images/Buttons/btnDel.gif"
                        ToolTip="Clear" OnClick="ibtClearManufacturer_Click" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtManufacturerNameS"
                        ErrorMessage="*" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
                    <asp:Panel ID="pnlInputManufacturer" runat="server" CssClass="Popup_Table" Style="display: none;
                        width: 420px">
                        <div class="Popup_Title">
                            <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                                <tr>
                                    <td>
                                        <strong>Chọn nhà sản xuất</strong>
                                    </td>
                                    <td align="center" style="padding-right: 2px; width: 20px">
                                        <div class="Popup_BtClose" style="width: 16px; height: 17px; text-align: center">
                                            <asp:LinkButton ID="lbtManufacturer" runat="server" CssClass="Popup_BtClose" Style="height: 17px">&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Popup_Content">
                            <uc1:SearchObject ID="SOManufacturer" runat="server" />
                        </div>
                    </asp:Panel>
                    <ajax:ModalPopupExtender ID="mpeManufacturer" runat="server" BackgroundCssClass="ModalPopupBackground"
                        CancelControlID="lbtManufacturer" PopupControlID="pnlInputManufacturer" TargetControlID="btnChooseManufacturer">
                    </ajax:ModalPopupExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td>
            Đơn vị tính:
        </td>
        <td>
            <asp:UpdatePanel ID="udpUnit" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox ID="txtUnitNameS" runat="server" ReadOnly="true" Width="230px"></asp:TextBox>
                    <asp:Button ID="btnChooseUnit" runat="server" CssClass="Control_ButtonBrowse" Text="..." />
                    <asp:ImageButton ID="ibtClearUnit" runat="Server" ImageUrl="~/App_Themes/Default/Images/Buttons/btnDel.gif"
                        ToolTip="Clear" OnClick="ibtClearUnit_Click" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtUnitNameS"
                        ErrorMessage="*" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
                    <asp:Panel ID="pnlInputUnit" runat="server" CssClass="Popup_Table" Style="display: none;
                        width: 420px">
                        <div class="Popup_Title">
                            <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                                <tr>
                                    <td>
                                        <strong>Chọn đơn vị tính</strong>
                                    </td>
                                    <td align="center" style="padding-right: 2px; width: 20px">
                                        <div class="Popup_BtClose" style="width: 16px; height: 17px; text-align: center">
                                            <asp:LinkButton ID="lbtUnit" runat="server" CssClass="Popup_BtClose" Style="height: 17px">&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Popup_Content">
                            <uc1:SearchObject id="SOUnit" runat="server">
                            </uc1:SearchObject>
                    </asp:Panel>
                    <ajax:ModalPopupExtender ID="mpeUnit" runat="server" BackgroundCssClass="ModalPopupBackground"
                        CancelControlID="lbtUnit" PopupControlID="pnlInputUnit" TargetControlID="btnChooseUnit">
                    </ajax:ModalPopupExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
        <td>
            Trạng thái sản phẩm:
        </td>
        <td>
            <asp:UpdatePanel ID="udpProductStatus" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox ID="txtProductStatusNameS" runat="server" ReadOnly="true" Width="230px"></asp:TextBox>
                    <asp:Button ID="btnChoseProductStatus" runat="server" CssClass="Control_ButtonBrowse"
                        Text="..." />
                    <asp:ImageButton ID="ibtClearProductStatus" runat="Server" ImageUrl="~/App_Themes/Default/Images/Buttons/btnDel.gif"
                        ToolTip="Clear" OnClick="ibtClearProductStatus_Click" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtProductStatusNameS"
                        ErrorMessage="*" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
                    <asp:Panel ID="pnlProductStatus" runat="server" CssClass="Popup_Table" Style="display: none;
                        width: 420px">
                        <div class="Popup_Title">
                            <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                                <tr>
                                    <td>
                                        <strong>Chọn trạng thái sản phẩm</strong>
                                    </td>
                                    <td align="center" style="padding-right: 2px; width: 20px">
                                        <div class="Popup_BtClose" style="width: 16px; height: 17px; text-align: center">
                                            <asp:LinkButton ID="lbtProductStatus" runat="server" CssClass="Popup_BtClose" Style="height: 17px">&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="Popup_Content">
                            <uc1:SearchObject id="SOProductStatus" runat="server">
                            </uc1:SearchObject>
                    </asp:Panel>
                    <ajax:ModalPopupExtender ID="mpeProductStatus" runat="server" BackgroundCssClass="ModalPopupBackground"
                        CancelControlID="lbtProductStatus" PopupControlID="pnlProductStatus" TargetControlID="btnChoseProductStatus">
                    </ajax:ModalPopupExtender>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td>
            Thuế suất:
        </td>
        <td>
            <asp:TextBox ID="txtVAT" runat="server" MaxLength="4" Width="100px" ValidationGroup="checkDataInput"> </asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                ControlToValidate="txtVAT" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
            <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
                Enabled="True" TargetControlID="txtVAT" FilterType="Numbers">
            </ajaxToolkit:FilteredTextBoxExtender>
        </td>
        <td>
            <asp:CheckBox ID="chkIsSerial" runat="server" />Yêu cầu serial
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td>
            Phần trăm thuế suất:
        </td>
        <td>
            <asp:TextBox ID="txtVATPercent" runat="server" MaxLength="4" Width="100px" ValidationGroup="checkDataInput"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                ControlToValidate="txtVATPercent" ValidationGroup="checkDataInput"></asp:RequiredFieldValidator>
            <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"
                Enabled="True" TargetControlID="txtVATPercent" FilterType="Numbers">
            </ajaxToolkit:FilteredTextBoxExtender>
        </td>
        <td>
            <asp:CheckBox ID="chkIsActived" runat="server" />Kích hoạt
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td>
            Hình sản phẩm:
        </td>
        <td>
            <asp:FileUpload ID="FileUpload1" runat="server" OnLoad="FileUpload1_Load" />
        </td>
        <td>
            <asp:Image runat="server" ID="imgsanpham" />
        </td>
        <td>
            <asp:ImageButton ID="imgdeleteimage" runat="Server" ImageUrl="~/App_Themes/Default/Images/Buttons/btnDel.gif"
                OnClick="imgdeleteimage_Click" />
        </td>
    </tr>
    <tr>
        <td>
            Mô tả sản phẩm:
        </td>
        <td class="NoStyle" valign="bottom">
            <asp:TextBox ID="txtDescription" runat="server" Height="80px" MaxLength="2000" TextMode="MultiLine"
                Width="200%"></asp:TextBox>&nbsp;
        </td>
    </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
    <tr>
        <td class="Title_Left1">
            &nbsp;
        </td>
        <td class="Title_Title1">
            Thuộc tính sản phẩm
        </td>
        <td class="Title_Separator1">
            &nbsp;
        </td>
        <td class="Title_None1">
            &nbsp;
        </td>
        <td class="Title_Right1">
            &nbsp;
        </td>
        <td align="right" style="padding-right: 10px;">
        </td>
    </tr>
</table>
<table cellpadding="0" cellspacing="0" style="width: 100%">
    <tr>
        <td>
            <uc2:Product_ProductAttributeList ID="Product_ProductAttributeList1" runat="server"
                Visible="false" />
            <uc3:ProductAttributeInput ID="ProductAttributeInput1" runat="server" />
        </td>
    </tr>
</table>
<table cellpadding="0" cellspacing="0" class="View_Table" style="width: 100%">
    <tr>
        <td style="width: 18%;">
            &nbsp;
        </td>
        <td style="width: 32%;">
            <asp:Button ID="btSave" runat="server" CssClass="Control_Button1" OnClick="btnSave_Click"
                Text="Lưu" ValidationGroup="checkDataInput" />
            <asp:Button ID="btnReturn" runat="server" CssClass="Control_Button1" Text="Bỏ qua"
                OnClick="btnReturn_Click" />
        </td>
    </tr>
</table>
